﻿#include "network_conf.h"
#include "network_info.h"

CNetworkConfParser::CNetworkConfParser(): m_cfg(new NetworkConf())
{
    
}

CNetworkConfParser::~CNetworkConfParser()
{
    delete m_cfg;
}

bool CNetworkConfParser::Parser(XMLElement* root)
{
    m_cfg->max_raw_pack_size = root->FirstChildElement("max_raw_pack_size")->UnsignedText();
    m_cfg->min_raw_pack_size = root->FirstChildElement("min_raw_pack_size")->UnsignedText();
    m_cfg->max_recv_cache_count = root->FirstChildElement("max_recv_cache_count")->UnsignedText();
    m_cfg->max_send_cache_count = root->FirstChildElement("max_send_cache_count")->UnsignedText();
    m_cfg->tick = root->FirstChildElement("tick")->UnsignedText();
    return true;
}

const NetworkConf* CNetworkConfParser::cfg()
{
    return m_cfg;
}
